package router

import (
	"choujiang/box_server/handler"
	"choujiang/common/middleware"

	"github.com/gin-gonic/gin"
)

func Register(router *gin.Engine) {
	router.GET("ping", handler.Ping)
	router.GET("1RD2qrlGAz.txt", handler.ReadFileContent)
	router.GET("CDXZ09fSxy.txt", handler.ReadNewFileContent)
	r := router.Group("/api/v1")
	r.Use(middleware.CORSMiddleware())
	r.Use(middleware.ParseForm)
	RegisterCommon(r)
	RegisterBox(r)
	RegisterLog(r)
	RegisterGoods(r)
	RegisterOrders(r)
	RegisterAddress(r)
	RegisterTask(r)
	RegisterShare(r)
	RegisterFeedback(r)
	RegisterNews(r)
	RegisterUser(r)
	RegisterRegion(r)
	RegisterAward(r)
	RegisterAdvert(r)
	RegisterGroup(r)
	RegisterParty(r)
	RegisterPayment(r)
	RegisterGames(r)
	RegisterCoupon(r)
	RegisterCategory(r)
}

func RegisterV2(router *gin.Engine) {
	r := router.Group("/api/v2")
	r.Use(middleware.CORSMiddleware())
	r.Use(middleware.ParseForm)
	RegisterCommon(r)
	RegisterBox(r)
	RegisterCoupon(r)
	RegisterShare(r)
	RegisterUser(r)
	RegisterLog(r)
	RegisterAlert(r)
	RegisterGroup(r)
}
